import request from '@/utils/request'
//获取任务列表
export function getTaskList(query) {
  return request({
    url: '/system/task/list',
    method: 'get',
    params: query
  })
}
//任务发起
export function addTaskList(data) {
  return request({
    url: '/system/task/add',
    method: 'post',
    data: data
  })
}
//任务详情
export function getTaskDetail(query) {
  return request({
    url: '/system/task/detail',
    method: 'get',
    params: query
  })
}
//任务编辑
export function updateTadk(data) {
  return request({
    url: '/system/task/update',
    method: 'post',
    data: data
  })
}
//任务完结
export function getTaskDeal(data) {
  return request({
    url: '/system/task/deal',
    method: 'post',
    data: data
  })
}
//任务撤销
export function cancelTask(data) {
  return request({
    url: '/system/task/cancel',
    method: 'post',
    data: data
  })
}
//新增评论
export function addTaskcomment(data) {
  return request({
    url: '/system/task/comment/add',
    method: 'post',
    data: data
  })
}
//删除文件
export function delTaskFileList(data) {
  return request({
    url: '/system/task/file/delete',
    method: 'post',
    data: data
  })
}
//删除评论
export function delTaskComment(id) {
  return request({
    url: '/system/task/comment/delete/' + id,
    method: 'post'
  })
}
//评论列表
export function getTaskCommentList(query) {
  return request({
    url: '/system/task/comment/list',
    method: 'get',
    params: query
  })
}

//获取商机模块的任务列表
export function getTaskBusinessList(query) {
  return request({
    url: '/system/task/business/list',
    method: 'get',
    params: query
  })
}
//内部订单模糊搜索
export function getOrdinnerorder(query) {
  return request({
    url: 'ord/ordinnerorder/getList',
    method: 'get',
    params: query
  })
}
//采购订单模糊搜索
export function getOrdpurchaseorder(query) {
  return request({
    url: 'ord/ordpurchaseorder/getList',
    method: 'get',
    params: query
  })
}

// 获取项目列表
export function getProjectNodeList(data) {
  return request({
    url: 'system/task/businesslist',
    method: 'post',
    data
  })
}

// 编辑项目
export function editProjectNode(data) {
  return request({
    url: 'system/task/businessedit',
    method: 'post',
    data
  })
}

// 删除项目
export function delProjectNode(id) {
  return request({
    url: 'system/task/businessdel?businessId=' + id,
    method: 'post'
  })
}

// 查询业务名称
export function getBusinessName(params) {
  return request({
    url: 'system/task/businesslistpassed',
    method: 'post',
    params
  })
}

// 任务导入
export function importTask(data) {
  return request({
    method: 'post',
    url: '/system/task/importtask',
    data
  })
}
// 模板下载
export function importtemplate() {
  return request({
    method: 'post',
    url: '/system/task/importtemplate',
    responseType: 'blob'
  })
}

// 任务切换周视图
export function getWeekViewData(data) {
  return request({
    method: 'post',
    url: '/system/task/taskcalendar',
    data
  })
}
